// components/model/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    model: {
      type: Object,
      value: {}
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    //确定函数
    success(e) {
      console.log(this.properties.model)
      console.log(this.data.model)
      let res = {
        errMsg: "showModal:ok",
        cancel: true,
        confirm: false
      }
      if (e.currentTarget.dataset.confirm == "true") {
        res.cancel = !res.cancel
        res.confirm = !res.confirm
      }
      let modelShow = this.data.modelShow
      modelShow = false
      this.setData({
        modelShow
      })
      this.properties.model.success(res)
    }
  }
})